package com.yesep.learn.design.behavioral.interpreter.calculator;

public class MultiplicationExpression implements IExpression {
    private final IExpression left;
    private final IExpression right;

    public MultiplicationExpression(IExpression left, IExpression right) {
        this.left = left;
        this.right = right;
    }

    @Override
    public double interpret(Context context) {
        return left.interpret(context) * right.interpret(context);
    }
}